﻿using Basic.WxApiService.Interface;

namespace Basic.WxApiService.WxModel
{
    public class ComponentToken : IComponentToken
    {
        private readonly IWxPlaformTokenService _Service;
        public ComponentToken (string token,
            string appId,
            IWxPlaformTokenService service)
        {
            this.Token = token;
            this.AppId = appId;
            this._Service = service;
        }
        public string AppId { get; }

        public string Token { get; private set; }
        public void ResetToken ()
        {
            this.Token = this._Service.Reset(this.AppId);
        }
    }
}
